<!-- 首页-门店列表-门店信息		information -->
<template>
	<view class="warps  pb30" v-if="data != []">
		<view class="" style="position:relative;">
			<image style="width: 750rpx;height: 302rpx;" :src="data.img" mode="aspectFill"></image>
		</view>
		<view class="information-dianpu">
			<view class="w95">
				<view class="f b">
					<view>
						<image style="width: 120rpx;height: 120rpx;" :src="data.logo" mode=""></image>
					</view>
					<view class="f d">
						<view class="wd100 f b">
							<view class="fs32 bold wd100 ellipsis-2" style="min-height: 80rpx;">{{data.name}}</view>
						</view>
						<view class="vw70 f b c pt3">
							<!-- <text class="fs28 hui">营业时间</text> -->
							<text class="fs20 hui">营业时间：{{data.yytime}}</text>
							<view class="fs24 right" style="color: #ff7105;">评分{{data.score}}</view>
						</view>
					</view>
				</view>
				<view class="quanxian"></view>
				<view class=" p_t_10 dis-flex flex-align-center flex-between">
					<view class="wd90">
						<view class="fs30 mt2 wd100 ellipsis ">地址：{{data.address}}{{data.address}}{{data.address}}
						</view>
						<view class="fs20 hui mt5 ">距离：{{data.juli}}</view>
					</view>
					<view class="" @click.stop="godizhi()">
						<image style="width:32rpx;height:32rpx;padding-top:40rpx;" src="../../../static/img/006.png"
							mode=""></image>
					</view>
				</view>
			</view>
			
		</view>
		<view class=" mt60 ml15 mr15">
			<view class="w95 f b c p_t_40">
				<text class="bold fs38">教练介绍</text>
				<view @click="all(data.coachList)">
					<text class="bold blue mr5">全部</text>
					<image style="width: 20rpx;height: 20rpx;" src="../../../static/img/007.png" mode=""></image>
				</view>
			</view>
			<view class="bb pb10" v-if="index < 3"  @click="examine(item)" v-for="(item,index) in data.coachList" :key="index">
				<view class="w95 f b">
					<view>
						<image style="width: 160rpx;height: 160rpx;border-radius: 200rpx;" :src="item.img" mode=""></image>
					</view>
					<view class="vw65 f d ml15">
						<text class="fs28 bold">{{item.name}}</text>
						<text class="fs20 hui p_t_20">{{item.content ? item.content :'无简介'}}</text>
						<view class="information-but">
							<button type="default">查看</button>
						</view>
					</view>
				</view>
			</view>
			
			<view class="w95 f b c p_t_20">
				<text class="bold fs38">门店课程</text>
				<view @click="quanbukecheng(data.id)">
					<text class="bold blue">全部</text>
					<image style="width: 20rpx;height: 20rpx;" src="../../../static/img/007.png" mode=""></image>
				</view>
			</view>
			<view class="bb pb10" @click="toMbiaoti(item.id)" v-for="(item,index) in data.courseList" :key="index">
				<view class="w95 f b">
					<view>
						<image style="width: 220rpx;height: 156rpx;" class="br5" :src="item.img" mode=""></image>
					</view>
					<view class="vw55 f d">
						<text class="fs28 bold ellipsis">{{item.name}}</text>
						<text class="fs16 hui p_t_10 ellipsis">{{item.title}}</text>
						<view class="f b flex-align-center mt20">
							<view class="fs20 hui ">
								<text>价格：{{item.xk_num}}课时</text>
							</view>
							<view class="information-buts" @click.stop="goyuyue(item.id)">
								<button type="default">立即预约</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listsa: [{
						url: '../../../static/img/015.png'
					}
				],
				id: '',
				lat: '',
				lng: '',
				data: []
			}
		},
		onLoad(e) {
			// 动态导航条文字
			uni.setNavigationBarTitle({
				title: '门店信息'
			})
			this.id = e.id
			this.lat = e.lat
			this.lng = e.lng
			this.init()
		},
		methods: {
			init() {
				var that = this
				var json = {
					id: that.id,
					lat: that.lat,
					lng: that.lng
				}
				that.$http.post(that.$config.UrlPoststoreDetail, json).then((res) => {
					if (res.status == 1) {
						that.data = res.data
					}
				})
			},
			all(item) {
				var data = encodeURIComponent(JSON.stringify(item))
				uni.navigateTo({
					url: "../../courses/coach/coach?data="+data
				})
			},
			examine(item) {
				var data = encodeURIComponent(JSON.stringify(item))
				uni.navigateTo({
					url: "../../courses/details/details?data="+ data
				})
			},
			//打开地图
			godizhi(e) {
				var e = this.data
				uni.openLocation({
					address: e.address,
					latitude: parseFloat(e.lat),
					longitude: parseFloat(e.lng),
					success: function(e) {

					}
				});
			},
			quanbukecheng(id){
				var that = this
				var json = {
					id: id
				}
				that.$http.post(that.$config.UrlPostsetDefault, json).then((res) => {
					if (res.status == 1) {
						uni.switchTab({
							url: "/pages/courses/courses"
						})
					}
				})
				
			},
			goyuyue(id){
				var token = uni.getStorageSync('token');
				if(token){
					uni.navigateTo({
						url:"/pages/courses/immediately/immediately?id="+id
					})
				}else{
					this.$api.openWindow('/pages/login/login')
				}
				
			},
			toMbiaoti(e) {
				uni.navigateTo({
					url: '../Details/Details?id=' + e
				})
			},

		}
	}
</script>

<style scoped>
	.warps {
		overflow: hidden;
		background-color: #FFFFFF;
	}

	.information-dianpu {
		width: 710rpx;
		height: 290rpx;
		opacity: 1;
		background: #ffffff;
		border-radius: 12rpx;
		box-shadow: 0rpx 6rpx 12rpx 0rpx rgba(0, 0, 0, 0.16);
		position: absolute;
		top: 132rpx;
		left: 22rpx;
	}

	.information-but {
		margin-left: 300rpx;
		margin-top: 20rpx;
	}

	.information-but>button {
		width: 128rpx;
		height: 40rpx;
		line-height: 40rpx;
		font-size: 24rpx;
		opacity: 1;
		background: #1f73f2;
		border-radius: 20rpx;
		color: #fff;
	}

	.information-buts>button {
		width: 160rpx;
		height: 36rpx;
		line-height: 36rpx;
		font-size: 24rpx;
		opacity: 1;
		background: #1f73f2;
		border-radius: 20rpx;
		color: #fff;
	}
</style>
